triangle sum theorem solve for x